import { lazy } from "react";
import { Navigate } from 'react-router-dom'
import { FriendsO, HomeO, Search, SettingO } from '@react-vant/icons'
const City=lazy(()=>import('../promise/City'))
const Detail=lazy(()=>import('../promise/Detail'))
const Home=lazy(()=>import('../promise/Home'))
const Login=lazy(()=>import('../promise/Login'))
const My=lazy(()=>import('../promise/My'))
const MyLayout=lazy(()=>import('../promise/MyLayout'))
const Mysusses=lazy(()=>import('../promise/Mysusses'))
const Outlist=lazy(()=>import('../promise/Outlist'))
const A404 = lazy(() => import('../promise/404'))
const Yd = lazy(() => import('../promise/Yd'))
const XX = lazy(() => import('../promise/XX'))

export const tabbars=[
    {
        path: '/home',
        element: <Home />,
        title: '首页',
        icon:<FriendsO/>
    },
    {
        path: '/Outlist',
        element: <Outlist />,
        title: '详情',
        icon:<HomeO/>
    },
    {
        path: '/Mysusses',
        element: <Mysusses />,
        title: '消息',
        icon:<Search/>
    },
    {
        path: '/My',
        element: <My />,
        title: '我的',
        icon:<SettingO/>
    },
]
export const routes = [
    {
        path: '/',
        element: <MyLayout />,
        children: [
            ...tabbars,
            {
                path: '/',
                element:<Navigate to='/home'></Navigate>
            }
        ]
    },
    {
        path: '/login',
        element:<Login/>
    },
    {
        path: '/city/:type',
        element:<City/>
    },
    {
        path: '/detail',
        element:<Detail/>
    },
    {
        path: '/yd',
        element:<Yd/>
    },
    {
        path: '/xx',
        element:<XX/>
    },
    {
        path: '*',
        element:<A404/>
    },
]